package org.yu.lemon.platform.common.exception;

import lombok.Getter;
import org.yu.lemon.platform.common.domain.ResultCode;

import java.io.Serial;
import java.io.Serializable;

@Getter
public abstract class BaseException extends RuntimeException implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;
    private int errorCode;

    BaseException() {}

    BaseException(ResultCode resultCode) {
        super(resultCode.getMessage());
        this.errorCode = resultCode.getCode();
    }
}
